﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using CCWin;

namespace DC.Views
{
    public partial class Form_NewUser : Skin_DevExpress
    {
        public string UserID = string.Empty;
        public int limit =0;
        Utils.Database DB = Utils.Global.GlobalDB;
        public Form_NewUser()
        {
            InitializeComponent();
        }

        private void label8_Click(object sender, EventArgs e)
        {

        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void skinButton1_Click(object sender, EventArgs e)
        {
            if (skinTextBox1.Text == string.Empty || skinTextBox2.Text == string.Empty || skinTextBox3.Text == string.Empty
                || skinTextBox4.Text == string.Empty || name.Text == string.Empty)
            {
                MessageBox.Show("请填写完整您的信息！");
                return;
            }
            if (skinTextBox4.Text !=skinTextBox3.Text) { MessageBox.Show("两次输入不一样");return; }
            string sql = string.Format(@"insert into [User]( User_Name, Password, Real_Name, Limit, Phone)values(
                                                '{0}','{1}','{2}',{3},'{4}')",
                                                skinTextBox2.Text,
                                                skinTextBox3.Text,
                                                name.Text,
                                                limit,
                                                skinTextBox1.Text
                                                );
            DB.Execute(sql);
            MessageBox.Show("注册成功！", "注册成功", MessageBoxButtons.OK, MessageBoxIcon.Information);
            this.Close();
        }
    }
}
